package com.binguo.api.controller;

import com.binguo.model.mapper.PayCardMapper;
import com.binguo.model.model.Customer;
import com.binguo.model.model.PayCard;
import com.binguo.thirdPay.zy.ZytkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ZytkController {

    @Autowired
    ZytkService zytkService;
    @Autowired
    PayCardMapper payCardMapper;

    @GetMapping("/api/zytk/getBalance")
    public String getZytkBalance(Customer customer){

        PayCard payCard = payCardMapper.selectPayCard(23,customer.getId(),new Byte("0"));
        if(payCard.getId() != Integer.valueOf(payCard.getCardno())){
            return zytkService.GetAccDBMoney(payCard.getCardno(), 23, ZytkService.cardType);
        }else{
            return null;
        }


    }
}
